package com.jk.eyedemo.base

import android.support.v4.app.Fragment
import com.jk.eyedemo.R
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.activity_main.view.*

/**
 * @Author:         jk
 * @CreateDate:     2018/11/28 19:49
 * @Description:   描述:
 */
var currentFragment = R.id.rb_home
val tabsId = listOf(R.id.rb_home, R.id.rb_category, R.id.rb_hot)

abstract class BaseFragment(tabId: Int) : Fragment(), RxNetManager {
    var tabId = 0

    init {
        this.tabId = tabId
    }

    private val disposables = CompositeDisposable()

    override fun onDestroyView() {
        super.onDestroyView()
        disposables.clear()
    }

    override fun dispose(disposable: Disposable) {

    }

    override fun addDisposable(disposable: Disposable) {

    }

    open fun setupToolbar(): Boolean {
        if (tabId != currentFragment) {
            return true
        }
        return false
    }


}